import request from "../utils/request";



let getSupplier = (page = 1, size = 5, data) => {
    return request({
        url: `/supplier/list/${page}/${size}`,
        method: 'GET',
        params: data
    })
}


let addSupplier = (data) => {
    return request({
        url: '/supplier',
        method: 'POST',
        data
    })
}


let delSupplier = (id) => {
    return request({
        url: `/supplier/${id}`,
        method: 'DELETE'
    })
}


let searchSupplier = (id) => {
    return request({
        url: `/supplier/${id}`,
        method: 'GET'
    })
}


let editSupplier = (id, data) => {
    return request({
        url: `/supplier/${id}`,
        method: 'PUT',
        data
    })
}


export default {
    getSupplier,
    addSupplier,
    delSupplier,
    searchSupplier,
    editSupplier
}